package com.caojing.syby.ui.details.viewpagerdetail;

import com.caojing.syby.bean.home.HomeGvBean;
import com.caojing.syby.httputils.HttpUtils;

import java.util.HashMap;

/**
 * Created by CaoJing on 2016/10/8.
 */
public class VpDetailPresenter implements VpDetailContract.Presenter {

    private VpDetailContract.Model model;
    private VpDetailContract.View view;

    public VpDetailPresenter(VpDetailContract.View view){
        this.view = view;
        this.model = new VpDetailModel();
    }
    @Override
    public void initGvData(HashMap<String, String> params) {
        model.getGvBean(params, new HttpUtils.HttpCallBack<HomeGvBean>() {
            @Override
            public void onSucess(HomeGvBean homeGvBean) {
                view.onSuccessGetGv(homeGvBean);
               // Log.i("TAG","presenter成功"+homeGvBean.getRows().size());

            }
            @Override
            public void onFail() {
                view.onFailGetGv("gv网络连接错误");
            }
        });
    }
}
